﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteAdmin.Master" Inherits="System.Web.Mvc.ViewPage<Beeldbankmvc.ViewModels.FiveStarViewModel>" %>

<%@ Import Namespace="Beeldbankmvc.Models" %>
<%@ Import Namespace="Beeldbankmvc.Controllers" %>
<%@ Import Namespace="Beeldbankmvc.ViewModels" %>
<%@ Import Namespace="Beeldbankmvc.Code" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">Vijf sterren media overzicht</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"><% Html.RenderAction("AdminMenu", "Miscellaneous"); %>
    <h2>Vijf sterren media overzicht</h2>
    <div style="float: right; margin-right: 24px;">
        <a href="<%= Url.Action("CleanupUnwantedShowInBanner", "MediaObject", new { mediaPageIndex = Model.pageIndex }) %>">
            <img alt="Opruimen ongewenste banner media" title="Opruimen ongewenste banner media" src="<%= AppHelper.getContent("~/Content/images/icon_clearstars_32px.gif")%>" /></a>
    </div>
    <table>
        <tr>
            <th>
            </th>
            <th>
                Preview
            </th>
            <th>
                Titel
            </th>
        </tr>
        <% foreach (FiveStarMedia item in Model.fiveStarObjects)
        {
        %>
            <tr>
                <td style="vertical-align: middle">
                    <%
                    if (!item.HasFiveStarCollection)
                    {%>
                        <a href="<%= Url.Action("AddTo5Stars", "MediaObject", new { mediaObjectId = item.BeeldbankMediaObject.Id, mediaPageIndex = Model.pageIndex }) %>">
                        <img alt="5 Sterren toekennen" title="5 Sterren toekennen" src="<%= AppHelper.getContent("~/Content/images/ok.png") %>" /></a>
                    <%
                    }
                    %>
                    <a href="<%= Url.Action("RemoveFrom5Stars", "MediaObject", new { mediaObjectId = item.BeeldbankMediaObject.Id, mediaPageIndex = Model.pageIndex }) %>">
                    <img alt="5 Sterren verwijderen" title="5 Sterren verwijderen" src="<%= AppHelper.getContent("~/Content/images/not ok.png") %>" /></a>
                </td>
                <td>
                    <a href="<%= Url.Action("Details", "MediaObject", new RouteValueDictionary(new { id = AppHelper.convertToUrlTitle(item.BeeldbankMediaObject.Omschrijving, item.BeeldbankMediaObject.Id) })) %>">
                        <%= Url.Image<HomeController>(c => c.DisplayThumb(item.BeeldbankMediaObject.Id.ToString()), 100, AppHelper.convertHtmlStringToAltTag(item.BeeldbankMediaObject), AppHelper.convertHtmlStringToAltTag(item.BeeldbankMediaObject), "") %>
                    </a>
                </td>
                <td style="vertical-align: middle">
                    <%: item.BeeldbankMediaObject.Titel %>
                </td>
            </tr>
        <%
        }
        %>
    </table>
    <div style="width: 100%; text-align: left;">
        <%
            int countPageIndex = 0;
            while (Model.numberOfRows > (countPageIndex * Model.pageSize))
            {
        %>
        <%:Html.ActionLink((countPageIndex + 1).ToString(), "FiveStarMedia", "MediaObject", new { mediaPageIndex = countPageIndex }, null)%>&nbsp;
        <%
                countPageIndex++;
            }
        %>
    </div>
</asp:Content>
